import os
import time
import requests
import json
import re

session = requests.session()


# con = session.get("https://www.caoporn.com/album/68190")
# # print(con)
# with open("I:/test/demo.txt", mode="w",encoding="utf-8") as f:
#     f.write(con.text)


def down_photo(maxnum=752802):
    for i in range(17568,maxnum):
        con = session.get(url="https://www.caoporn.com/media/photos/%s.jpg" % (str(i + 1)))
        print(i)
        with open("F:/9-game/123/%s.jpeg" % (str(i + 1)), mode="wb") as f:
            f.write(con.content)


if __name__ == "__main__":
    down_photo(maxnum=752802)
